package com.financing.wap.service.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import com.financing.wap.dao.IDstArticleDao;
import com.financing.wap.dto.DstArticleDTO;
import com.financing.wap.service.IDstArticleService;
import com.financing.wap.util.DTOdateSetUtil;
/**
 * dst_article  
 * 文章列表 业务访问层实现类
 * @author huqiyun
 *
 */
 
@Service("dstArticleService")
public class DstArticleServiceImpl implements IDstArticleService{

	@Autowired
	private IDstArticleDao dstArticleDao;

	@Override
	public int insert(DstArticleDTO dstArticle) throws SQLException {
		return dstArticleDao.insert(dstArticle);
	}

	@Override
	public void update(DstArticleDTO dstArticle) throws SQLException {
		dstArticleDao.update(dstArticle);
	}

	@Override
	public void updateForce(DstArticleDTO dstArticle) throws SQLException {
		dstArticleDao.updateForce(dstArticle);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		dstArticleDao.delete(id);
	}
	
	@Override
	public List<DstArticleDTO> queryList(DstArticleDTO dstArticle) throws SQLException {
		return dstArticleDao.queryList(dstArticle);
	}

	@Override
	public int queryListCount(DstArticleDTO dstArticle) throws SQLException {
		return dstArticleDao.queryListCount(dstArticle);
	}

	@Override
	public DstArticleDTO loadById(Integer id) throws SQLException {
		return dstArticleDao.loadById(id);
	}
 	@Override
	public DstArticleDTO queryListGetFirst(DstArticleDTO dstArticle)
			throws SQLException {
		 List<DstArticleDTO> queryList = queryList(dstArticle);
		 if(queryList==null||queryList.size()==0){
			 return new DstArticleDTO();
		 }
		 return queryList.get(0);
	}
}
